home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / expect / exp_command.h < prev    next >
C/C++ Source or Header  |  1993-03-29  |  3KB  |  86 lines

  1. /* command.h - definitions for expect commands
  2.  
  3. Written by: Don Libes, NIST, 2/6/90
  4.  
  5. Design and implementation of this program was paid for by U.S. tax
  6. dollars.  Therefore it is public domain.  However, the author and NIST
  7. would appreciate credit if this program or parts of it are used.
  8. */
  9.  
  10. struct f *exp_update_master();
  11.  
  12. #define get_var(x)    exp_get_var(interp,x)
  13. char *exp_get_var();
  14.  
  15. int get_timeout();
  16.  
  17. extern int exp_default_match_max;
  18. extern int exp_default_parity;
  19. int exp_one_arg_braced();
  20. int exp_eval_with_one_arg();
  21. void exp_lowmemcpy();
  22.  
  23.  
  24. #define USER_SPAWN_ID        0
  25. #define USER_SPAWN_ID_LIT    "0"
  26. /* only defined on FD_VALID descriptors */
  27. #define is_user(x)    ((x == 0) && (fs[x].flags & FD_USER))
  28. #define f_is_user(x)    ((x == fs) && (f->flags & FD_USER))
  29.  
  30. /* fd flags */
  31. #define FD_VALID    0x1    /* valid entry in fds table */
  32. #define FD_CLOSED    0x2    /* has been closed */
  33. #define FD_USER        0x4    /* stdin or stdout */
  34. #define FD_SYSWAITED    0x8    /* wait() has been called */
  35. #define FD_USERWAITED    0x10    /* expect's wait has been called */
  36.  
  37. /* each process is associated with a 'struct f'.  An array of these ('fs') */
  38. /* keeps track of all processes.  They are indexed by the true fd to the */
  39. /* master side of the pty */
  40. struct f {
  41.     int pid;
  42.     char *buffer;    /* input buffer */
  43.     char *lower;    /* input buffer in lowercase */
  44.     int size;    /* current size of data */
  45.     int msize;    /* size of buffer */
  46.     int umsize;    /* user view of size of buffer */
  47.     int flags;    /* see above */
  48.     int wait;    /* raw status from wait() */
  49.     int parity;    /* strip parity if false */
  50.     int printed;    /* # of characters written to stdout (if logging on) */
  51.             /* but not actually returned via a match yet */
  52.     int echoed;    /* additional # of chars (beyond "printed" above) */
  53.             /* echoed back but not actually returned via a match */
  54.             /* yet.  This supports interact -echo */
  55.     int key;    /* unique id that identifies what command instance */
  56.             /* last touched this buffer */
  57.     int force_read;    /* force read to occur (even if buffer already has */
  58.             /* data).  This supports interact CAN_MATCH */
  59.     int armed;    /* If Tk_CreateFileHandler is active */
  60. };
  61. extern struct f *fs;
  62.  
  63. struct f *exp_fd2f();
  64. int exp_adjust();
  65. int exp_close();
  66.  
  67. #define exp_deleteProc (void (*)())0
  68.  
  69. extern int expect_key;
  70.  
  71. extern int exp_disconnected;
  72.  
  73. void exp_create_commands();
  74. void exp_init_pty();
  75. void exp_init_expect();
  76. void exp_init_spawn();
  77. void exp_init_spawn_ids();
  78. void exp_init_spawn_id_vars();
  79. void exp_init_trap();
  80. void exp_init_unit_random();
  81. void exp_init_sig();
  82. void exp_init_debugger();
  83.  
  84. void exp_generic_sighandler();
  85.  
  86.